package scauCmiScaffolding.compiled;

import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;
import org.eclipse.jet.taglib.RuntimeTagElement;
import org.eclipse.jet.taglib.TagInfo;

public class _jet_scauCmijs implements JET2Template {
    private static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
    private static final String _jetns_f = "org.eclipse.jet.formatTags"; //$NON-NLS-1$

    public _jet_scauCmijs() {
        super();
    }

    private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
    
    private static final TagInfo _td_f_replaceAll_1_1 = new TagInfo("f:replaceAll", //$NON-NLS-1$
            1, 1,
            new String[] {
                "value", //$NON-NLS-1$
                "replacement", //$NON-NLS-1$
            },
            new String[] {
                "Dollar_symbol", //$NON-NLS-1$
                "$", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_replaceStrings_2_1 = new TagInfo("c:replaceStrings", //$NON-NLS-1$
            2, 1,
            new String[] {
                "replace", //$NON-NLS-1$
                "with", //$NON-NLS-1$
            },
            new String[] {
                "%Left_angle_brackets,%Right_angle_brackets,cchoose,cwhen,cset,cotherwise,cforEach,cif", //$NON-NLS-1$
                "<,>,c:choose,c:when,c:set,c:otherwise,c:forEach,c:if", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_36_21 = new TagInfo("c:get", //$NON-NLS-1$
            36, 21,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$project/@name", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_40_21 = new TagInfo("c:get", //$NON-NLS-1$
            40, 21,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$project/@name", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_49_21 = new TagInfo("c:get", //$NON-NLS-1$
            49, 21,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$project/@name", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_53_21 = new TagInfo("c:get", //$NON-NLS-1$
            53, 21,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$project/@name", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_248_11 = new TagInfo("c:get", //$NON-NLS-1$
            248, 11,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$project/@name", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_259_11 = new TagInfo("c:get", //$NON-NLS-1$
            259, 11,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$project/@name", //$NON-NLS-1$
            } );

    public void generate(final JET2Context context, final JET2Writer __out) {
        JET2Writer out = __out;
        RuntimeTagElement _jettag_f_replaceAll_1_1 = context.getTagFactory().createRuntimeTag(_jetns_f, "replaceAll", "f:replaceAll", _td_f_replaceAll_1_1); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_f_replaceAll_1_1.setRuntimeParent(null);
        _jettag_f_replaceAll_1_1.setTagInfo(_td_f_replaceAll_1_1);
        _jettag_f_replaceAll_1_1.doStart(context, out);
        JET2Writer _jettag_f_replaceAll_1_1_saved_out = out;
        while (_jettag_f_replaceAll_1_1.okToProcessBody()) {
            out = out.newNestedContentWriter();
            out.write(NL);         
            RuntimeTagElement _jettag_c_replaceStrings_2_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "replaceStrings", "c:replaceStrings", _td_c_replaceStrings_2_1); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_replaceStrings_2_1.setRuntimeParent(_jettag_f_replaceAll_1_1);
            _jettag_c_replaceStrings_2_1.setTagInfo(_td_c_replaceStrings_2_1);
            _jettag_c_replaceStrings_2_1.doStart(context, out);
            JET2Writer _jettag_c_replaceStrings_2_1_saved_out = out;
            while (_jettag_c_replaceStrings_2_1.okToProcessBody()) {
                out = out.newNestedContentWriter();
                out.write(NL);         
                out.write("//使用于loginPage.jsp, registerPage.jsp, backStageDecorator.jsp. frontSideDecorator.jsp");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("function changeCss(event) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar id = Dollar_symbol(event).attr(\"cid\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar title = id.split(\"-\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tsetStyleSheet(title[1]);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("// ref: alternate stylesheet");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("function setStyleSheet(title) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar link_list = document.getElementsByTagName(\"link\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif (link_list) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tfor (var i = 0; i < link_list.length; i++) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t// 要找到所有link中rel属性值包括style的，也就是包括stylesheet和alternate stylesheet;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tif (link_list[i].getAttribute(\"title\") != null) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t// 将符合条件的link的disabled的属性设为true，都改为禁用；");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tconsole.log(link_list[i].getAttribute(\"title\"));");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tlink_list[i].disabled = true;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t// 然后判断link标签中的title属性，找到我们需要替换的css文件");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t// 找到后将该link的disabled改为启用；");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tconsole.log(title + 'model');");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tif (link_list[i].getAttribute(\"title\") == title + 'model') {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tconsole.log(link_list[i]);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tlink_list[i].disabled = false;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function showPsw() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar type = Dollar_symbol(\"#scau-login-secret\").attr(\"type\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif (type == \"password\") {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tDollar_symbol(\"#scau-login-secret\").attr(\"type\", \"text\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar img = Dollar_symbol(\"#scau-login-eye\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\timg.attr(\"src\", \"/");  //$NON-NLS-1$        
                RuntimeTagElement _jettag_c_get_36_21 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_36_21); //$NON-NLS-1$ //$NON-NLS-2$
                _jettag_c_get_36_21.setRuntimeParent(_jettag_c_replaceStrings_2_1);
                _jettag_c_get_36_21.setTagInfo(_td_c_get_36_21);
                _jettag_c_get_36_21.doStart(context, out);
                _jettag_c_get_36_21.doEnd();
                out.write("/images/icons/Openeyes.png\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t} else {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tDollar_symbol(\"#scau-login-secret\").attr(\"type\", \"password\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar img = Dollar_symbol(\"#scau-login-eye\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\timg.attr(\"src\", \"/");  //$NON-NLS-1$        
                RuntimeTagElement _jettag_c_get_40_21 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_40_21); //$NON-NLS-1$ //$NON-NLS-2$
                _jettag_c_get_40_21.setRuntimeParent(_jettag_c_replaceStrings_2_1);
                _jettag_c_get_40_21.setTagInfo(_td_c_get_40_21);
                _jettag_c_get_40_21.doStart(context, out);
                _jettag_c_get_40_21.doEnd();
                out.write("/images/icons/eye.png\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function showPsw1() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar type = Dollar_symbol(\"#scau-login-secret1\").attr(\"type\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif (type == \"password\") {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tDollar_symbol(\"#scau-login-secret1\").attr(\"type\", \"text\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar img = Dollar_symbol(\"#scau-login-eye1\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\timg.attr(\"src\", \"/");  //$NON-NLS-1$        
                RuntimeTagElement _jettag_c_get_49_21 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_49_21); //$NON-NLS-1$ //$NON-NLS-2$
                _jettag_c_get_49_21.setRuntimeParent(_jettag_c_replaceStrings_2_1);
                _jettag_c_get_49_21.setTagInfo(_td_c_get_49_21);
                _jettag_c_get_49_21.doStart(context, out);
                _jettag_c_get_49_21.doEnd();
                out.write("/images/icons/Openeyes.png\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t} else {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tDollar_symbol(\"#scau-login-secret1\").attr(\"type\", \"password\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar img = Dollar_symbol(\"#scau-login-eye1\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\timg.attr(\"src\", \"/");  //$NON-NLS-1$        
                RuntimeTagElement _jettag_c_get_53_21 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_53_21); //$NON-NLS-1$ //$NON-NLS-2$
                _jettag_c_get_53_21.setRuntimeParent(_jettag_c_replaceStrings_2_1);
                _jettag_c_get_53_21.setTagInfo(_td_c_get_53_21);
                _jettag_c_get_53_21.doStart(context, out);
                _jettag_c_get_53_21.doEnd();
                out.write("/images/icons/eye.png\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function chooseSource() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol(\".scau-successsave\").css(\"display\", \"none\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol(\".scau-choosesource\").css(\"display\", \"\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("function chooseBack() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol(\".scau-choosesource\").css(\"display\", \"none\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("//function uploadExcel() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("//\tDollar_symbol(\".scau-choosesource\").css(\"display\", \"none\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("//\tDollar_symbol(\".scau-uploadexcel\").css(\"display\", \"\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("//}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("function uploadBack() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol(\".scau-uploadexcel\").css(\"display\", \"none\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol(\".scau-choosesource\").css(\"display\", \"\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write(NL);         
                out.write("var fileHash;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function uploadExcel(){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar flag;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar list = new FormData();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar file = Dollar_symbol('#fileChoose')[0].files[0];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif(file == null || file == undefined){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\talert(\"请先选择文件！\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\treturn;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar fileName = file.name;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar fileExt = fileName.split('.')[1];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar sourceId = Dollar_symbol('#sourceSelect').val();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif(sourceId == -1){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\talert(\"请选择来源！\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\treturn;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif (fileExt != 'xls' && fileExt != 'xlsx') {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\talert(\"上传的文件不是Excel文件！请重新选择文件！\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tflag = false;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tlist.append('file', file);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : 'uploadExcel?sourceId='+sourceId,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tdata : list,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'post',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tasync : false,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tprocessData : false,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tcontentType : false,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function(data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tconsole.log(data);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\thash = data.split(\"=\")[1];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tif (data == \"error\"){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\talert(\"该文件已被入库！请选择其他文件\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tflag = false;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\telse {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tfileHash = data;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tflag = true;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\treturn flag;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("Dollar_symbol(\"#addsource\").click(function() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\twindow.location.href = 'addSource';");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("});");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("/*");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" * var sourceid;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" * ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" * function uploadExcel() { Dollar_symbol.ajax({ url : 'getSourceId', type : 'post',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" * dataType : 'json', data : { \"sourceName\" : Dollar_symbol(\"#choose\").val() }, success :");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" * function(data) { Dollar_symbol(\".scau-choosesource\").css(\"display\", \"none\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" * Dollar_symbol(\".scau-uploadexcel\").css(\"display\", \"\"); sourceid = data; //");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" * window.location.href='uploadExcel?id=' + data; } }) };");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" */");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("function autoMatch(){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif(uploadExcel()){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar sourceId = Dollar_symbol('#sourceSelect').val();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\turl : 'autoMatch?hash='+fileHash+\"&&sourceId=\"+sourceId,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\ttype : 'get',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tasync : false,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tdataType : 'json',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tsuccess : function(data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tconsole.log(data);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tDollar_symbol(\"#ruleSelect\").html('');");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tDollar_symbol(\"#ruleSelect\").append(\"<option value='-1'>数据已填充，请选择</option>\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tif(data.length > 0){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tfor (i in data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\tcurrent = data[i];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\tDollar_symbol(\"#ruleSelect\").append(");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\"<option value='\" + current.id + \"'>规则编号\" + current.id");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t+ \"</option>\")");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\talert(\"数据库中可能匹配的规则已经填充到下拉列表中!\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t}else{");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\talert(\"该来源下没有可能匹配的规则！请新建规则！\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("function saveFileRecord(ruleId) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t//检查之前是否有上传过文件，如果没有则上传");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif(!fileHash || typeof(fileHash) == 'undefined' || fileHash == null){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tif(!uploadExcel()){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\treturn;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar ruleId = Dollar_symbol(\"#ruleSelect\").val();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : 'storeExcel?hash=' + fileHash + '&&ruleId=' + ruleId,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'post',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\talert(\"Excel文件已经成功上传到服务器！请返回列表页面对文件进行入库操作！\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\twindow.location.href='listExcels';");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function changesource(obj) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar sourceid = Dollar_symbol(obj).val();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : 'getRules?sourceId=' + sourceid,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'get',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tasync : false,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tdataType : 'json',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function(data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tconsole.log(data);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tDollar_symbol(\"#ruleSelect\").html('');");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tDollar_symbol(\"#ruleSelect\").append(\"<option value='-1'>请选择...</option>\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tfor (i in data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tcurrent = data[i];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tDollar_symbol(\"#ruleSelect\").append(");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\"<option value='\" + current.id + \"'>规则编号\" + current.id");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t+ \"</option>\")");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function changetable(obj) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar ruleid = Dollar_symbol(obj).val();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : 'getRuledetails?ruleId=' + ruleid,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'get',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tasync : false,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tdataType : 'json',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function(data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tconsole.log(data);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tDollar_symbol(\"#confirmrule-tbody\").html('');");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tfor (i in data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tone = data[i];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tDollar_symbol(\"#confirmrule-tbody\").append(");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\"<tr><td>\" + one.colname + \"</td><td>\" + one.tablename");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t+ \"</td><td>\" + one.field + \"</td></tr>\")");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function goToChooseRule() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t//检查之前是否有上传过文件，如果没有则上传");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tif(!fileHash || typeof(fileHash) == 'undefined' || fileHash == null){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tif(!uploadExcel()){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\treturn;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\twindow.location.href = 'chooseRule?' + \"hash=\" + fileHash;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function goToImportXls() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar ruleid = Dollar_symbol(\"#ruleSelect\").val();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tvar param = decodeURI(window.location.href);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\thash = param.split(\"=\")[1];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : 'importXls?hash=' + hash + '&&ruleId=' + ruleid,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'post',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tDollar_symbol(\".scau-successsave\").css(\"display\", \"\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function saveExcelContent(excelId) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'post',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : '/");  //$NON-NLS-1$        
                RuntimeTagElement _jettag_c_get_248_11 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_248_11); //$NON-NLS-1$ //$NON-NLS-2$
                _jettag_c_get_248_11.setRuntimeParent(_jettag_c_replaceStrings_2_1);
                _jettag_c_get_248_11.setTagInfo(_td_c_get_248_11);
                _jettag_c_get_248_11.doStart(context, out);
                _jettag_c_get_248_11.doEnd();
                out.write("/importXls?excelId=' + excelId,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\talert(\"数据入库成功！\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\twindow.location.href=\"listExcels\"");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function cleanExcel(excelId) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'post',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : '/");  //$NON-NLS-1$        
                RuntimeTagElement _jettag_c_get_259_11 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_259_11); //$NON-NLS-1$ //$NON-NLS-2$
                _jettag_c_get_259_11.setRuntimeParent(_jettag_c_replaceStrings_2_1);
                _jettag_c_get_259_11.setTagInfo(_td_c_get_259_11);
                _jettag_c_get_259_11.doStart(context, out);
                _jettag_c_get_259_11.doEnd();
                out.write("/cleanExcel?excelId=' + excelId,");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\talert(\"数据删除成功！\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\twindow.location.href=\"listExcels\"");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function saveBack() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\twindow.location.href = 'listExcels';");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function seeExcel() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\twindow.location.href = 'showAllExcel';");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function addSource() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\twindow.location.href = 'newSource';");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function chooseruleBack() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol(\".scau-chooserule\").css(\"display\", \"none\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol(\".scau-choosesource\").css(\"display\", \"\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(NL);         
                out.write("function chooseruleOk() {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\tDollar_symbol.ajax({");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\turl : 'createSource',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\ttype : 'post',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tdataType : 'json',");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tdata : {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\"sourceName\" : Dollar_symbol(\"#add\").val()");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t},");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tsuccess : function(data) {");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\twindow.location.href = 'adapter';");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t})");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("}");  //$NON-NLS-1$        
                out.write(NL);         
                _jettag_c_replaceStrings_2_1.handleBodyContent(out);
            }
            out = _jettag_c_replaceStrings_2_1_saved_out;
            _jettag_c_replaceStrings_2_1.doEnd();
            out.write(NL);         
            _jettag_f_replaceAll_1_1.handleBodyContent(out);
        }
        out = _jettag_f_replaceAll_1_1_saved_out;
        _jettag_f_replaceAll_1_1.doEnd();
    }
}
